#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
  int a, n = 0;
  int m = 1;
  cin >> a;
  int arr[20] = {0};
  int arr1[20] = {0};
  int arr2[20] = {0};
  int arr3[20] = {0};
  for (int i = 0; i < a; i++)
  {
    scanf("%d", &arr1[i]);
  }
  for (int i = 0; i < a; i++)
  {
    arr[i] = arr1[i];
  }
  for (int i = 0; i < a - 1; i++)
  {
    for (int j = i + 1; j < a; j++)
    {
      if (arr1[i] > arr1[j])
      {
        int temp = arr1[i];
        arr1[i] = arr1[j];
        arr1[j] = temp;
      }
    }
  }
  for (int i = 0; i < a; i++)
  {
    arr3[i] = m;
    if (arr1[i] != arr1[i + 1])
    {
      m++;
    }
  }
  for (int i = 0; i < a; i++)
  {
    for (int j = 0; j < a; j++)
    {
      if (arr[i] == arr1[j])
      {
        arr2[i] = arr3[j];
      }
    }
  }
  for (int i = 0; i < a; i++)
  {
    cout << arr2[i] << " ";
  }
  return 0;
}
